package tech.aistar.service.demand.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.aistar.entity.Demand;
import tech.aistar.mapper.deamnd.DemandMapper;
import tech.aistar.service.demand.IDemandService;


import java.util.List;

/**
 * Created by 豆梦寒 on 2019/9/27.
 */
@Service
public class DemandServiceImpl implements IDemandService {
    @Autowired
    private DemandMapper demandMapper;


    @Override
    public List<Demand> findAll() {
        List<Demand> list = demandMapper.findAll();
        return list;
    }

    @Override
    public Demand findByd(Integer id) {
        return demandMapper.findByd(id);
    }

    @Override
    public List<Demand> findById(Integer userinfo_id) {
        List<Demand> list = demandMapper.findById(userinfo_id);
        return list;
    }

    @Override
    public Demand add(Demand demand) {
        demandMapper.add(demand);

        return demand;
    }

    @Override
    public void updateDemand(Demand demand) {
        demandMapper.updateDemand(demand);
    }

    @Override
    public void deletDemand(Integer id) {
        demandMapper.delById(id);
    }

    @Override
    public void delById(Integer id) {
        demandMapper.delById(id);
    }
}
